<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<!--
        编写函数翻转字符串
-->

<script>

    function fn(str) {
        return str.split('').reverse().join("");
    }

    var str = '1234567'
    console.log(fn(str));


</script>
</body>
</html>